Ext.define('Holo.view.spot.FormCreateSpotDescContent', {
    extend: 'Ext.form.Panel',
    alias : 'widget.createspotdesccontent',
    height: 400,
    width: 700,
    border :false,
    bodyPadding: 10,
    frameHeader: false,
    id:'SpotDescriptionsContentForm',
    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'combobox',
                    fieldLabel: Label.get('LAB902'),
                    name :'codelang',
                    store: GlobalData.storeChoiceLanguage,
                    queryMode: 'local',
                    allowBlank: false,
		    value:'FR',
	            blankText:Error.get('ERR005'),
                    editable : false,
                    displayField: 'labelLang',
                    valueField: 'codeLang'
                },{
                    xtype: 'textfield',
                    name :'title',
                    fieldLabel: Label.get('LAB145'),
                    maxLength:60,
                    width: 350,
		    value:'TEST titre',
                    allowBlank: false,
	            blankText:Error.get('ERR005'),
                    maxLengthText:Error.get('ERR003'),
                    minLength:5,
                    minLengthText:Error.get('ERR002')
                },
                {
                    xtype: 'radiogroup',
                    fieldLabel: Label.get('LAB140'),
                    items: [
                        {
                            xtype: 'radiofield',
                            name : 'type',
                            inputValue:'P',
                            checked : true,
                            id: 'typeP',
                            boxLabel: Label.get('LAB141')
                        },
                        {
                            xtype: 'radiofield',
                            name : 'type',
                            inputValue:'T',
                            id: 'typeT',
                            boxLabel: Label.get('LAB142')
                        },
                        {
                            xtype: 'radiofield',
                            name : 'type',
                            inputValue:'V',
                            id: 'typeV',
                            boxLabel: Label.get('LAB143')
                        },
                        {
                            xtype: 'radiofield',
                            name : 'type',
                            inputValue:'A',
                            id: 'typeA',
                            boxLabel: Label.get('LAB144')
                        },
                    ]
                },
		{   //When a file is submit we need to create a folder with a name of the idtext of the current spot
                    xtype: 'hiddenfield',
		    name: 'idtextspot',
		    value: 'null' //setted when the form is submit (see controller)
                },
		{
                    xtype: 'textareafield',
                    name :'description',
                    fieldLabel: Label.get('LAB146'),
                    maxLength:1000,
		    hidden  : false,
		    disabled: false,
		    value:'TEST BALBLA',
                    allowBlank: true,
                    width: 350,
                    height :70,
	            blankText:Error.get('ERR005'),
                    maxLengthText:Error.get('ERR003'),
                    minLength:0,
                    minLengthText:Error.get('ERR002')
                },		
                {
                    xtype: 'filefield',
                    name: 'file',
                    disabled: false,
                    hidden  : false,
                    //labelWidth: 50,
                    allowBlank: false,
                    blankText:Error.get('ERR005'),
                    buttonText: Label.get('LAB147')
                },

                {
                    xtype: 'htmleditor',
                    name:'textContent',
                    allowBlank: false,
                    blankText:Error.get('ERR005'),
                    minHeight : 100,
                    minWidth : 100,
                    disabled: true,
                    hidden  : true,
                    resizable: true,
                    enableColors: false,
                    enableAlignments: false
                }
            ],
            
            buttons :[{
                        text: Label.get('LAB901'),
                        action:'createspotdesccontent',
                        formBind: true, //only enabled once the form is valid
                        disabled: true
                    }]
        });

        me.callParent(arguments);
    }

});